#{extends 'main.html' /}
#{set title:'商户管理' /}
<script type="text/javascript" src="/public/sui/js/lrz.all.bundle.js"></script>
<script type="text/javascript" src="/public/sui/js/uploadImg.js"></script>
<script type="text/javascript" src="/public/sui/js/qrcode.min.js"></script>
<script type="text/javascript" src="/public/sui/js/list.js"></script>
<script type="text/javascript" src="/public/sui/js/uploadIdImg.js"></script>
<script type="text/javascript" src="/public/sui/layer_mobile/layer.js"></script>


<script>
    var mainImage = '${mainImage}';
    var qrCodeBase = '${qrCodeBase}';
    var linkId = '${linkId}';
    var idImg = '${idImg}';

    $(function () {

        if (mainImage != null && mainImage != '') {
            initImg(mainImage);
            $("#addli").hide();
        }
        if (idImg != null && idImg != '') {
            initImg2(idImg);
            $("#addli2").hide();
        }

        //点击查看二维码
        $(document).on('click', '.QR_code', function () {
            layer.open({
                content: '<div id="qrCode_id"class="qrCodeDelivery" style="width: 100%;height: 98%;"></div>'
            });

            $('#qrCode_id').html('');
            var url = qrCodeBase;
            var qrcode = new QRCode(document.getElementById("qrCode_id"), {width: 260, height: 260});
            qrcode.clear();
            qrcode.makeCode(url);

        })

    })


</script>

<body>
<div class="page-group">
    <div class="page">
        <header class="bar bar-nav">
            <a href="javascript:history.go(-1);" class="icon icon-left pull-left"></a>

            <h1 class="title">店铺信息</h1>
        </header>
        <section class="shop_info content scroll_y" style="margin-bottom: 1rem;">
            <div class="list-block">
                <form name="form1" method="post" action="">
                    <input id="id_merchantId" value="${merchant.id}" type="hidden">

                    <ul>
                        <!-- Text inputs -->
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">店铺名称</div>
                                    <div class="item-input">
                                        <input id="id_name" type="text" name="name" value="${merchant.name}"
                                               placeholder="请输入">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">证件号码</div>
                                    <div class="item-input">
                                        <input id="id_code" type="text"  name="idCode" value="${merchant.idCode}"
                                               placeholder="请输入">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="content-block uploadPic">
                                <h3>证件照</h3>
                                <input type="file" accept="image/*" id="cameraInput2" name="cameraInput2" style="display:none;"/>
                                <input type="file" accept="image/*" id="cameraInput_andriod2" name="cameraInput_andriod2"
                                       style="display:none;"/>
                                <ul>
                                    <li id="addli2" class="add create-actions2"><img src="/public/sui/images/icon_add2.gif"></li>
                                </ul>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">商户类型</div>
                                    <div class="item-input">
                                        <select name="type" id="type">
                                            <option value="STUDENT"   #{if merchant.type.toString() == 'STUDENT' } selected #{/if} >学生</option>
                                            <option value="GETI"    #{if merchant.type.toString() == 'GETI' } selected  #{/if}>个体商户</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">登录名称</div>
                                    <div class="item-input">
                                        <input id="id_loginName_name" type="text" name="loginName" value="${merchant.loginName}"
                                               placeholder="密码修改">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">登录密码</div>
                                    <div class="item-input">
                                        <input id="id_password" type="password" name="password" value=""
                                               placeholder="请确认密码">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">确认密码</div>
                                    <div class="item-input">
                                        <input id="id_password_2" type="password" name="" value=""
                                               placeholder="请输入">
                                    </div>
                                </div>
                            </div>
                        </li>

                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">店铺电话</div>
                                    <div class="item-input">
                                        <input id="id_servicePhone" type="text" name="servicePhone"
                                               value="${merchant.servicePhone}" placeholder="请输入">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">真实姓名</div>
                                    <div class="item-input">
                                        <input id="realName" type="text" name="realName"
                                               value="${merchant.realName}"readonly>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">班级</div>
                                    <div class="item-input">
                                        <input id="classes" type="text" name="classes"
                                               value="${merchant.classes}" readonly>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">微信号</div>
                                    <div class="item-input">
                                        <input id="weChat" type="text" name="weChat"
                                               value="${merchant.weChat}" placeholder="请输入">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">指导教师</div>
                                    <div class="item-input">
                                        <input id="teacher" type="text" name="teacher"
                                               value="${merchant.teacher}" placeholder="请输入">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">团队名称</div>
                                    <div class="item-input">
                                        <input id="team" type="text" name="team"
                                               value="${merchant.team}" placeholder="请输入">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title label">商户地址</div>
                                    <div class="item-input">
                                        <input id="address" type="text" name="address"
                                               value="${merchant.address}" placeholder="请输入">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="item-content item-link">
                                <div class="item-inner">
                                    <div class="item-title label">二 &nbsp;维 &nbsp;码</div>
                                    <div class="item-after QR_code" >点击获取二维码
                                    *{<img src="/public/sui/images/2w.jpg"/>}*

                                    </div>
                                </div>
                            </div>
                        </li>

                        <li>
                            <div class="content-block uploadPic">
                                <h3>商户Logo</h3>
                                <input type="file" accept="image/*" id="cameraInput" name="cameraInput"
                                       style="display:none;"/>
                                <input type="file" accept="image/*" id="cameraInput_andriod" name="cameraInput_andriod"
                                       style="display:none;"/>
                                <ul>
                                    <li id="addli" class="add create-actions">
                                        <img src="/public/sui/images/icon_add2.gif">
                                    </li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                #{if merchant.verifyState.toString() == 'PASS' }
                    <div class="content-block">
                        <input type="button" name="button" class="button button-fill button-pink"
                               onclick="saveMerchant(null)" value="保存">
                    </div>
                #{/if}
                    #{if merchant.verifyState.toString() == 'WAIT' }
                        <div class="content-block">
                            <input type="button" name="button" class="button button-fill button-pink"
                                   onclick="saveMerchant('WAIT')" value="提交审核">
                        </div>
                    #{/if}
                </form>
            </div>

        </section>

    #{include 'footer.html'/}
    </div>
</div>

<div id="img_tmp" style="display: none;">
    <li class="img">
        <a href="#"><i class="iconfont">&#xe6d3;</i></a>
        <img src="" id="img_src"/>
        <input type="hidden" class="imgs" id="img_src_hidden" value="imgSrc"/>
    </li>
</div>
<div id="img_tmp2" style="display: none;">
    <li class="img2">
        <a href="#"><i class="iconfont">&#xe6d3;</i></a>
        <img src="" id="img_src2"/>
        <input type="hidden" class="imgs2" id="img_src_hidden2" value="imgSrc2"/>
    </li>
</div>
<script>
    $.init();
</script>
</body>
